<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.app.service.vo.UserVo"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'corn-add.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="<%=request.getContextPath() %>/wang-css/reset.css" type="text/css" rel="stylesheet" />
	<link href="<%=request.getContextPath() %>/wang-css/eos-system.css" type="text/css" rel="stylesheet" />
	<link href="<%=request.getContextPath() %>/wang-css/eos-cms.css" type="text/css" rel="stylesheet" />
	
  </head>
  
  <body>
<script type="text/javascript">
// validate the comment form when it is submitted
		$("#form1").validate({
			rules: {
				name: {
					required: true,
					minlength: 2
				},
				email: {
					required: true,
					email: true
				},
				password: {
					required: true,
					minlength: 6
				},
				username: {
					required: true,
					minlength: 2
				}
			},
			messages: {
				name:{
					required:"name is not null",
					minlength:"min length 2"
				},
				email: {
					required: 'Enter this!',
					email:"email error"
				},
				username: {
					required: 'username is not null',
					minlength:"min length 2"
				},
				password:{
					required: 'password is not null',
					minlength:"min length 6"
				}
			}
		});
</script>

<div class="nav-list clearfix">	<a href="javaScript:manageDiv('adduserdiv')">添加新用户</a></div>
<div class="yuan-div">
	<div class="data-table eos-m-l">
	<table style="font-family: arial, 宋体; font-size: 12px;" width="100%" cellpadding="0" cellspacing="0">
		<thead>
            	<tr>
                	 <th>用户名</th>
					<th>操作</th>
                </tr>
            </thead>
             <tbody>
       <%
			List<UserVo> uservolist = (List<UserVo>) request
					.getAttribute("uservolist");
			if (null != uservolist) {
				for (UserVo vo : uservolist) {
		%>
		<tr>
				<td>
			<%=vo.getUsername()%></td>
			<td><a href="#" onclick="javascript:addTab('<%=vo.getId()%>_show','<%=request.getContextPath()%>/admin/showuserbyid.form?userid=<%=vo.getId()%>','查看用户信息')" >查看用户信息</a>
			</td>
			</tr>

		<%
			}
			}
		%>
            </tbody>
	</table>
	</div>
	<div id="adduserdiv" style="display:none" >
		<h5 class="c-info-title">添加用户信息</h5>
		<form id="form1" action="<%=request.getContextPath()%>/admin/adduser.form"
			method="post">
			<table style="font-family: arial, 宋体; font-size: 12px;" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td>用户名</td>
					<td><input type="text" name="username" id="username"/>
					</td>
					<td>密码</td>
					<td><input type="text" name="password" id="password"/>
					</td>
				</tr>
				<tr>
					<td>用户真实姓名</td>
					<td><input type="text" name="name" id="name"/>
					</td>
					<td>用户电话</td>
					<td><input type="text" name="telent" id="telent"/>
					</td>
				</tr>

				<tr>
					<td>邮箱</td>
					<td><input type="text" name="email" id="email"/>
					</td>
					<td>QQ</td>
					<td><input type="text" name="qq" id="qq"/>
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<p>
							<input id="submit" type="submit" value="增加新用户" />
						</p></td>

				</tr>
			</table>
		</form>
	</div>
</div>
</body>
</html>
